﻿using System;
using System.Collections.Generic;
using System.Text;
using VueIRepository;
using VueIServices;
using VueModel;

namespace VueServices
{
    public class UserService : IUserService
    {
        private readonly IUserRepository _userRepository;

        public UserService(IUserRepository userRepository)
        {
            this._userRepository = userRepository;
        }

        public bool AddUser(UserModel model)
        {
            return _userRepository.AddUser(model);
        }

        public bool DelUser(int userId)
        {
            return _userRepository.DelUser(userId);
        }

        public List<UserModel> GetUserList()
        {
            return _userRepository.GetUserList();
        }
        //public ResultModel<List<UserModel>> GetUsers()
        //{
        //    return new ResultModel<List<UserModel>>
        //    {
        //        Data = _userRepository.GetUserList(),
        //        Total = _userRepository.GetUserList().Count
        //    };
        //}

        public bool ModefyUser(UserModel model)
        {
            return _userRepository.ModefyUser(model);
        }
    }
}
